<?php
require_once 'bbs/include/common.inc.php';

$sql = !empty($accessmasks) ?
			"SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect, ff.extra, a.allowview FROM {$tablepre}forums f
				LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
				LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
				WHERE f.status>'0' ORDER BY f.type, f.displayorder"
			: "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect, ff.extra FROM {$tablepre}forums f
				LEFT JOIN {$tablepre}forumfields ff USING(fid)
				WHERE f.status>'0' ORDER BY f.type, f.displayorder";

$query = $db->query($sql);
$bbsResult = Array();
$i = 0;
while($forum = $db->fetch_array($query)) {
	if($forum["fid"] == "2" || $forum["fid"] == "3"){
		$bbsResult[$i] = $forum;
		$i++;
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>北京市京师律师学校</title>
<link rel="stylesheet" href="./css/base.css" type="text/css"/>
<link rel="stylesheet" href="./css/superfish.css" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/hoverIntent.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript" src="js/jquery.marquee.js"></script>
<script type="text/javascript">
$(function()
{
	$("#navigationMenu").superfish();
});
</script>
<style>
ul.marquee {
	/* required styles */
	display: block;
	padding: 0;
	margin: 0;
	margin-left : 100px;
	list-style: none;
	line-height: 1;
	position: relative;
	overflow: hidden;

	/* optional styles for appearance */
	width: 300px;
	height: 30px; /* height should be included to reserve visual space for the marquee */
}

ul.marquee li {
	/* required styles */
	position: absolute;
	top: -999em;
	left: 0;
	display: block;
	white-space: nowrap; /* keep all text on a single line */

	/* optional styles for appearance */
	font: 14px Arial, Helvetica, sans-serif;
	padding: 3px 5px;
}
</style>
</head>
<body>
<div class="PageContainer w954px">
	<? include("classes/page_header.php"); ?>
	<div class="PageContent">
		<div class="PageContentBlock PicturesMarquee">
			<script type="text/javascript">
			var imgUrl1 = "images/banner/01.jpg";
			var imgtext1 = "";
			var imgLink1 = "";
			var imgUrl2 = "images/banner/02.jpg";
			var imgtext2 = "";
			var imgLink2 = "";
			var imgUrl3 = "images/banner/03.jpg";
			var imgtext3 = "";
			var imgLink3 = "";
			var imgUrl4 = "images/banner/04.jpg";
			var imgtext4 = "";
			var imgLink4 = "";

			var focus_width = 952;
			var focus_height = 321;
			var text_height = 0;
			var swf_width = 950;
			var swf_height = 319;

			var pics = imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4;
			var links = imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4;
			var texts = imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4;

			document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
			document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="fl/focus1.swf"><param name="quality" value="high"><param name="bgcolor" value="#dbdbdb">');
			document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
			document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
			if($.browser.msie)
				document.write('<embed src="fl/focus1.swf" width="950" height="319" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" salign="T" name="scriptmain" menu="false" wmode="transparent" flashvars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"></embed>')
			document.write('</object>');
			</script>
		</div>
		
		<div class="PageContentBlock Announcement">
		
<ul id="marquee" class="marquee"> 

<?php
$query = $db->query("select * from article where topiccode = '600' order by id desc limit 10");
while($aricle = $db->fetch_array($query)) {
?>
						<li><a href="./news.php?newsid=<?php echo $aricle['id'];?>" class="AnnouncementTitle1 cropped1"><?php echo $aricle['title'];?>[<?php echo date("m-d", $aricle['inputtime']);?>] </a></li>
<?php
}
?>
</ul>

<script type="text/javascript"> 
$(document).ready(function (){ 
  $("#marquee").marquee(); 
}); 
</script>

			
			<a href="./topic.php?id=600" class="More">More</a>
		</div>
		
		<div class="PageContentBlock News">
			<div class="Title">
				<a class="Left" href="./topic.php?id=200">More</a>
				<a class="Right" href="./topic.php?id=500">More</a>
			</div>
			<div class="NewsLinks inlineBlockWrapper">
				<div class="SchoolNews inlineBlock">
<?php

$query = $db->query("select * from article where topiccode = '200' order by id desc limit 5");
while($aricle = $db->fetch_array($query)) {
?>					
					<div style="border:0px red solid">[<?php echo date("m-d", $aricle['inputtime']);?>]&nbsp;&nbsp;<a class="NewsLink1 cropped1" href="./news.php?newsid=<?php echo $aricle['id'];?>"><?php echo $aricle['title'];?></a></div>

<?php
}
?>
				</div>
				<div class="LawNews inlineBlock">
					<ul>
<?php

$query = $db->query("select * from article where topiccode = '500' order by id desc limit 5");
while($aricle = $db->fetch_array($query)) {
?>
					<div style="border:0px red solid">[<?php echo date("m-d", $aricle['inputtime']);?>]&nbsp;&nbsp;<a class="NewsLink1 cropped1" href="./news.php?newsid=<?php echo $aricle['id'];?>"><?php echo $aricle['title'];?></a></div>
<?php
}
?>
					</ul>
				</div>
			</div>
		</div>
		
		<div class="PageContentBlock PicturesList">
			<a href="javascript:;" title="法律英语培训" class="ImageLink Training"><img src="images/pictureslist/01.jpg"/></a>
			<a href="javascript:;" title="京师课堂" class="ImageLink Classroom"><img src="images/pictureslist/02.jpg"/></a>
			<a href="javascript:;" title="司法考试专区" class="ImageLink ExamZone"><img src="images/pictureslist/03.jpg"/></a>
			<a href="javascript:;" title="律师事务专区" class="ImageLink LawyersZone"><img src="images/pictureslist/04.jpg"/></a>
			<a href="javascript:;" title="海外事务专区" class="ImageLink OverseasZone"><img src="images/pictureslist/05.jpg"/></a>
		</div>
		
		<div class="PageContentBlock BBS">
			<div class="Title">
				<a href="bbs/">More</a>
			</div>
<?php
for($i = 0; $i < count($bbsResult); $i++)
{
?>
			<div class="Section inlineBlockWrapper">
				<div class="Icon inlineBlock"></div>
				<div class="Brief inlineBlock">
					<h3><a href="bbs/forumdisplay.php?fid=<?=$bbsResult[$i]["fid"]?>"><?=$bbsResult[$i]["name"]?></a></h3>
					<p class="Description cropped"><?=$bbsResult[$i]["description"]?></p>
					<p class="Moderators cropped">版主： <a href="javascript:;"><?=$bbsResult[$i]["moderators"]?></a></p>
				</div>
				<div class="Statistics inlineBlock">
					<span class="blue"><?=$bbsResult[$i]["threads"]?></span> / 
					<span class="gray"><?=$bbsResult[$i]["posts"]?></span>
				</div>
				<?php
					$lastpost = $bbsResult[$i]["lastpost"];
					$lastpostArr = explode("\t", $lastpost);
				?>
				<div class="LatestPost inlineBlock">
					<p class="Caption cropped"><a href="javascript:;"><?=$lastpostArr[1]?></a></p>
					<p class="Author cropped">by <a href="javascript:;"><?=$lastpostArr[3]?></a></p>
				</div>
			</div>
<?php
}
?>
		</div>
		<div class="PageContentBlock Partners">
			<div class="LinksContainer inlineBlockWrapper">
			<?php
			$query = $db->query("SELECT * FROM link2 ORDER BY displayorder");
			while($forumlink = $db->fetch_array($query)) {
			?>
				<a class="inlineBlock" href="<?=$forumlink["url"]?>" target="_blank"><?=$forumlink["title"]?></a>
			<?php
			}
			?>
			</div>
		</div>
		
		<div class="PageContentBlock FriendlyLinks">
			<div class="LinksContainer inlineBlockWrapper">
			<?php
			$query = $db->query("SELECT * FROM {$tablepre}forumlinks ORDER BY displayorder");
			while($forumlink = $db->fetch_array($query)) {
			?>
				<a class="ImageLink inlineBlock" href="<?=$forumlink["url"]?>" target="_blank"><img width="110" height="40" title="<?=$forumlink["name"].$forumlink["description"]?>" src="<?=$forumlink["logo"]?>"/></a>
			<?php
			}
			?>
		</div>
	</div>
	<? include("classes/page_footer.php"); ?>	
</div>
</body>
</html>